package com.acando.feide;

import java.util.ArrayList;
import java.util.List;

// Class representing a LDAP attribute
public class LDIFItem {

    // internal name
    private String internalId;
    // Name of the LDAP attribute
    private String ldapAttribute;
    // List of values for this LDAP attribute
    private List<String> values;

    public LDIFItem(String internalId, String ldapAttribute) {
        super();
        this.internalId = internalId;
        this.ldapAttribute = ldapAttribute;
    }

    public String getInternalId() {
        return internalId;
    }

    public void setInternalId(String internalId) {
        this.internalId = internalId;
    }

    public String getLdapAttribute() {
        return ldapAttribute;
    }

    public void setLdapAttribute(String ldapAttribute) {
        this.ldapAttribute = ldapAttribute;
    }

    public List<String> getValues() {
        if (values == null) {
            values = new ArrayList<String>();
        }
        return values;
    }

    public void addValue(String value) {
        if (value != null && !value.isEmpty()) {
            this.getValues().add(value);
        }
    }

}
